<script setup lang="ts">

import MyButton from "@/components/common/myButton.vue";
import {useRoute, useRouter} from "vue-router";
import {useAccountStore} from "@/stores/account";
import {ElMessage} from "element-plus";
const router = useRouter()
const route = useRoute();
const accountStore = useAccountStore();
const handleClick = () => {
  if (accountStore.enterprise.is_admin && route.query.enterpriseId == accountStore.enterprise.enterpriseId) {
    router.push('/addstaff')
  }
  else {
    ElMessage.error('您不是本企业的管理员')
  }
}
</script>

<template>
  <span class="enterprise-push-wrapper">
    <my-button type="light" @click="handleClick">员工管理</my-button>
  </span>
</template>

<style scoped>
.enterprise-push-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 500px;
  border-radius: 15px;
  background-color: white;
  border: 2px solid var(--color-plain);
}
</style>